package net.zjitc.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

  // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
  public static String app_id = "2016082600315833";

  // 商户私钥，您的PKCS8格式RSA2私钥
  public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCmVxRohPRqL84D0LnVFsJfRwtQk3tOQGC+vVbodOSsN7MIMDjbBH+Xt4Cs3TWpKOrxIRAT9MFaV1oKoAGCMEECk6B3V3csVHLDREDr0VasPU78SiduZrNqNOaC3zBv/hMQ3N0XFqzhyolAiI7Di3rPCwnW9ex7VY3TMaD+aK1k+O7zYGajsqqsAvdBFHi/kAYjaKLblE2f71JoY1uLd5XE9D7pBBoOXMSmkNONfa4oCGPAHRlbQJcPwxAhmFuMfRneZos0FGC3eR/uxFYi+ycqzlr0nX5b4ngZ3wfW1jSi3YQyr828KDBQkkIDy2iy5wU4OX/XX9Nmi3vSQUIIqmxTAgMBAAECggEAGQ+xoXW2pXECZwzBkttU+anoiIFP6KBGczZvq6JA+bmCnc82Iblxx9f76Q+DEDN8Akxq8bbEkunqRQOKdqTyhoLbgF+LMwCeMdFMvrrRhi3OgrBhdH7AtVW3DSy3TYhIMxgzr1DZR0OOnkx0xf1zyVHub5apxINFVPZ7PRlkVnvzlqz04YcVEW487lQO4lZZzCBv1e58IMjiE+DFw4ZVzIxq0RL3vI+N5Rb5w7SEOtwIvX7OpHLXs3/9jk+9iLojya4P44XoiGjL/CXzSwF88gkK8kpE22k82sWuIOWy6drEtZgNU2KDrrfJatutwL0XPxla5RjKFGywFxP3RnONYQKBgQD6wxJauBdt8/RjtYkrfr1kECKQtqwvF05KrobNYZBks3anUZAC9bLwlp4ENlc+Ay/KeNGWCLjamw79hQ0Fq4ucQpDah9Bx+SNoUg6KyUPZLc7PFPdC+vI7NY41BEcJZ5yrFevw5nqQ2VEczHRyESQhDmb7+zArDDQkTsJvnF1z6wKBgQCp0JHHTkjGYFbMdyPf76Po5QOzFmEkuSM2KrlodWYlbiWdDKXL69Qg/vhIw2mkRdFmyRh8V2r0IzKr1JBrzO+23Ah3OutQUsGqarmlXnde56KMQP+Y7i87mGN3pjqnHuXUsgf5Xl4n6XMGWMG2r5WSYr3gqneMN4cV35XjNnSXOQKBgBOFiDJDzp8itM3mXg1iyn+1udsmPXVVDSVHPPtUMxeD2SLheKKiWhHcx+RwDo6nVNsgWMCjYTCzjZEzAHaGilHZ5Mj+db3JtXXznWo0jPGlXUpFyZIPUzhEzRNXh+g1hr7S8BFLABOyt1vUluQibXudUWsgfPl887o3328s7yGNAoGAD4Fbzjb3riVdx42ZWPkonjtK+y8v74p4DJoaE8+kZAaKqKxe9x+xXtHpGbu+CaHWXOw/sBrLST9tgQMHrNApkyjEHR7kHZFw3X6hNNhLTf8YeHX24J/e8DIZ4vLqqBfKJIGc+MgFEN/gANRZ27Rsk9EwRTNLdyIa04R2yyhNvQECgYEAkeNWTxvbkhDf3lwpF4C+d2ncgOrMhGxUh7MIrzYeUuFw7vNI+0Dng0W/0cAl3/SgsyJSmkM8aF1Lr4P0Q51CTAV0IiC9oomTxt1x5MzRckMEGVMv6si2+6KVERXMYdqezCiE5fC4zMUEVMLPCTUrz0fygoXkrt+qv+8Kdn1RMo0=";
  // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
  public static String alipay_public_key = "\n"
      + "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3wsQI68OHF0W2OjU4eR2Br491rLN6BtHo/nwlviGQXsLvpiRsXcXU0bG8q6aYLAh7XotFpchhL1kuh6cNlJ0ZBMu1bqph4Rtk177Y6TgJUdZouoJJtW7Xrg0/XH7gU/xvv7wP6F85T1hTH4A5+VBSWmimpGBqJY05OfGgGlQ1vxn4UCjt59c1Q91YJ3N+fxvD9ENW8VR//hP4HRF6j41zK9KaIxYUSERrGU+ooJLRHyNiHlbbti8apG1c36uRAg4xzMjke4Yy06WSZkC4nnkMaL+OakILaR9WZg4KbraUvGOfs5TBxSJirYpByCvzAvMqGJ+tjvfCsmyJmCtiJQJQwIDAQAB";
  // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8080/zhifubao/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8080/order_editState.do";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

